// pages/login/login.js
const app = getApp()
var isFirst =true;
var isSiFirst=true;
Page({

    /**
     * 页面的初始数据
     */
    data: {
        zhuangtai:false,
        bili:50,
        xuewangbi:13,
        picture:'',
        touxiang:'',
        nickname:''
    },
    jump(){

        wx.switchTab({
          url: "/pages/order/order",
        })
      
       },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad() {
        this.setData({
            nickname:wx.getStorageSync('userinfo').nickName,
            touxiang:wx.getStorageSync('userinfo').avatarUrl
        })
        this.getlocation()
        var that=this
        wx.cloud.database({}).collection("page_swiper_picture").get({
            success(res){
                var picture=res.data[0].picture
                that.setData({
                    picture
                })
            }
        })
        this.setData({
            zhuangtai:wx.getStorageSync('zhuangtai'),
            bili:wx.getStorageSync('bili'),
            xuewangbi:wx.getStorageSync('xuewangbi')
          })
    },
    getlocation(){
        wx.getLocation({
          type:'wgs84',
          success(res){
            wx.setStorageSync('userlocation', res)
          }
        })
      },
      quanyi(){
          wx.navigateTo({
            url:"/pages/mixue/mixue",
          })
      }

})